<% include ../header %>
  <h2>【<a href="/shop/<%=shop._id%>" target="_blank"><%=shop.name%></a>】的图片菜单</h2>
  <div class="hero-unit">
  <% if(shop.picmenu){ %>
    <img src="<%=shop.picmenu%>" />
  <% }else{ %>
    暂无图片菜单
  <% } %></div>
  <div class="actions">
    <form method="post" action="upload" enctype="multipart/form-data">
      <input type="file" name="picmenu" id="picmenu" placeholder="(亲，我只认jpg格式的图片哦)">
        <script type="text/javascript" src="/js/camilize.js"></script>
        <script>
          $('#picmenu').camilize({
            btnClass:'btn btn-primary', 
            btnText: '用我的摄像头把菜单照下来',
            btnStopClass:'btn btn-success', 
            btnStopText: '用我的摄像头把菜单照下来',
            error:function (err) {
              alert('少年，只有最新版本的Chrome和Opera才支持这么懒的做法啊！');
            }
          });
        </script>
      <button type="submit" class="btn btn-primary">更换图片菜单</button>
      <% if(shop.picmenu){ %>
      <a class="btn btn-primary btn-danger" href="upload">删除图片菜单</a>
      <% } %>
    <form>
  </div>
<% include ../footer %>